/**
 * 
 */
package org.t2.game.server.foundation.ssh;

import org.springframework.stereotype.Component;

import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.annotation.WebListener;

/**
 * 
 */
//@WebListener
//@Component
public class MyContextListener implements ServletContextListener {

	private SshConnection sshConnection;
	
	@Override
	public void contextInitialized(ServletContextEvent sce) {
		sshConnection = new SshConnection();
		sshConnection.connect();
		System.out.println("ssh连接成功");
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		sshConnection.close();
		System.out.println("ssh关闭");
	}

	
}
